//
//  VGIMSessionListViewController.swift
//  IMTest
//
//  Created by 宋海胜 on 2019/4/16.
//  Copyright © 2019年 宋海胜. All rights reserved.
//  im 会话列表页

import UIKit

class VGIMSessionListViewController: NIMSessionListViewController {

    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        if #available(iOS 13.0, *) {
            UIApplication.shared.setStatusBarStyle(UIStatusBarStyle.darkContent, animated: false)
        } else {
            UIApplication.shared.setStatusBarStyle(UIStatusBarStyle.default, animated: false)
        }
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        print(NSHomeDirectory() + "/Documents")
    }
    
    override func onSelectedRecent(_ recent: NIMRecentSession!, at indexPath: IndexPath!) {
        let vc: VGIMOCSessionViewController = VGIMOCSessionViewController(session: recent.session!) {
            DispatchQueue.main.async {
//                BadgeValueUtils.NEW_IMMESSAGE_COUNT = NIMSDK.shared().conversationManager.allUnreadCount()
            }
        }
        self.navigationController?.pushViewController(vc, animated: true)
    }
    
    override func headerViewClicked(_ Index: Int) {
        if Index == 0 {
//            let suggestionVC = InviteFamilyAndMineController()
//            suggestionVC.isRootVC = true
//            suggestionVC.allowInviClosure = {
//                self.changeAccount()
//            }
//            self.navigationController?.pushViewController(suggestionVC, animated: true)
        } else {
//            let noticeVC = NoticeController.newInstance(isShareDynamic: false)
//            self.navigationController?.pushViewController(noticeVC, animated: true)
        }
    }

    override func changeAccount() {
        super.changeAccount()
    }
}
